import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/position',
    method: 'GET',
    params: query
  })
}

export function fetchPosition(query) {
  return request({
    url: `/position/GetAllByTenant/${query}`,
    method: 'GET'
  })
}

export function getPosition(id) {
  return request({
    url: `/position/${id}`,
    method: 'GET'
  })
}

export function savePosition(data) {
  return request({
    url: '/position',
    method: 'POST',
    data
  })
}

export function deletePosition(id) {
  return request({
    url: `/position/${id}`,
    method: 'DELETE'
  })
}

export function updatePosition(data) {
  return request({
    url: `/position/${data.Id}`,
    method: 'PUT',
    data
  })
}
